﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Web.Mvc;

namespace CafeOnline.MvcFramework.Web {
    public class AreaViewEngine : WebFormViewEngine {
        #region Constructor
        /// <summary>
        /// Initialises a new instance of <see cref="AreaViewEngine" />.
        /// </summary>
        public AreaViewEngine() {
            ViewLocationFormats = new[]
                                    {
                                        "~/Areas/Views/{1}/{0}.cshtml",
                                        "~/Areas/Views/Shared/{0}.cshtml",
                                        "~/Views/{1}/{0}.cshtml",
                                        "~/Views/Shared/{0}.cshtml"
                                    };

            MasterLocationFormats = new[]
                                    {
                                        "~/Areas/{2}/Views/{1}/{0}.cshtml",
                                        "~/Areas/{2}/Views/Shared/{0}.cshtml",
                                        "~/Views/{1}/{0}.cshtml",
                                        "~/Views/Shared/{0}.cshtml"
                                    };

            PartialViewLocationFormats = new[]
                                    {
                                        "~/Areas/{1}/Views/{1}/{0}.cshtml",
                                        "~/Areas/Views/{1}/{0}.cshtml",
                                        "~/Views/{1}/{0}.cshtml",
                                        "~/Views/Shared/{0}.cshtml"
                                    };
        }
        #endregion
    }
}
